#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QTcpServer>
#include <QNetworkProxy>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    connect(this->ui->pushButton, SIGNAL(clicked()), this, SLOT(close()));
    this->server_connection = new Connection(QNetworkProxy(QNetworkProxy::NoProxy), 0);
    this->ui->label->setText("Servidor criado na porta " +
                             QString::number(this->server_connection->server->serverPort()) + ".");
    this->ui->label->setAlignment(Qt::AlignCenter);
}

MainWindow::~MainWindow()
{
    delete ui;
}
